<template>
  <div class="father">
    <h3>父组件</h3>
    <div class="content">
      <Game title="热门游戏列表">
        <template v-slot="{ games }">
          <ul style="text-align: left">
            <li v-for="g in games" :key="g.id">{{ g.name }}</li>
          </ul>
          <h3>v-slot="{games}"</h3>
        </template>
      </Game>
      <Game title="今日美食城市">
        <template v-slot="{ imgUrl }"><img :src="imgUrl" alt="" /> <h3>v-slot="{imgUrl}"</h3></template>
      </Game>
      <Game title="今日影视推荐">
        <template v-slot="{ videoUrl }"><video :src="videoUrl" controls></video> <h3>v-slot="{videoUrl}"</h3></template>
      </Game>
    </div>
  </div>
</template>

<script setup lang="ts">
import Game from "./Game.vue";
</script>

<style scoped>
.father {
  background-color: rgb(165, 164, 164);
  padding: 20px;
  border-radius: 10px;
}
.content {
  display: flex;
  justify-content: space-evenly;
}
img,
video {
  width: 100%;
}
h3 {
    text-align: center;
    color:tomato;
}
</style>
